﻿using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhuXingFamilys.MainFamilyView
{
    [Transaction(TransactionMode.Manual)]
    internal class FamilyAttributeCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            string PageGuid = "321044f7-b0b2-4b1c-af18-e71a19252be0";
            Guid guid = new Guid(PageGuid);
            DockablePaneId paneId = new DockablePaneId(guid);
            DockablePane pane = uiapp.GetDockablePane(paneId);
            if (pane.IsShown())
            {
                pane.Hide();
            }
            else
            {
                pane.Show();
            }
            return Result.Succeeded;
        }
    }
}
